<template>
	<view>
		<uni-search-bar placeholder="搜索公益"></uni-search-bar>
		<uni-group >
			<uni-card v-for="(item,index) in fen" :title="item.name" >
				<view @click="xian(item.name)">
					<view class="">
						项目类型:{{item.type.name}}
					</view>
					<view class="">
						公益类别:{{item.type.name}}
					</view>
					<view class="">
						公益内容：{{item.description == ''?'没有内容':iten.description}}
					</view>
					<view class="">
						项目时间：{{item.activityAt}}
					</view>
					<view>发布人:{{item.author}}</view>
					<view>参捐人数:{{item.donateCount}}</view>
					<view>已筹善款:{{item.moneyNow}}元</view>
				</view>
				<button type="warn" @click.stop="juan(item.id)">我要捐赠</button>
			</uni-card>
		</uni-group>
		<uni-group style="position: fixed;right: 0%;left: 0%;bottom: 0%;">
			
		</uni-group>
	</view>
</template>

<script>
	import api from 'commer/apiURL.js'
	export default {
		data() {
			return {
				base:api.baseurl,
				fen:[]
			}
		},
		onLoad(options) {
			this.getlun(options.id,options.name)
		},
		methods: {
			juan(id){
				uni.navigateTo({
					url:'juan?id='+id
				})
			},
			xian(name){
				uni.navigateTo({
					url:'xianq?id='+name
				})
			},
			getlun(id,name){
				this.$get(this.base+'/prod-api/api/public-welfare/public-welfare-activity/list',{
					typeId:id,
					name:name
				}).then((res)=>{
					this.fen = res.rows		
				})
			}
		}
	}
</script>

<style>

</style>
